<?php
$channel_id = $_POST["channel_id"];
$channel_name = $_POST['channel_name'];
$channel_type = $_POST['channel_type'];
$channel_leader = $_POST['channel_leader'];
$channel_phone = $_POST['channel_phone'];
include_once("../../untils/conn.php");
if ($con) {
  mysqli_query($con, "set names utf8");
  $data = $con->query("UPDATE channel SET channel_name='" . $channel_name . "',channel_type='" . $channel_type . "',channel_leader='" . $channel_leader . "',channel_phone='" . $channel_phone . "' WHERE channel_id='" . $channel_id . "'");
  if ($data > 0) {
      echo $data;
    echo "<script>alert('修改成功');window.location.href='../channel.php'</script> ";
  } else {
    echo ("<script>alert('修改失败');window.location.replace(document.referrer)</script>");
    // echo "Error updating record: " . $con->error;
  }
  
}

$con->close();


